package com.lineage.data.item_etcitem;

import com.lineage.data.executor.ItemExecutor;
import com.lineage.server.model.Instance.L1ItemInstance;
import com.lineage.server.model.Instance.L1PcInstance;
import com.lineage.server.serverpackets.S_ServerMessage;
import com.lineage.server.serverpackets.ServerBasePacket;
import java.util.Random;

public class Locerr extends ItemExecutor {
  private static Random _random = new Random();
  
  public static ItemExecutor get() {
    return new Locerr();
  }
  
  public void execute(int[] data, L1PcInstance pc, L1ItemInstance item) {
    if (item == null)
      return; 
    if (pc.isParalyzed() || pc.isSleeped() || pc.isParalyzedX())
      return; 
    if (pc.isDead())
      return; 
    if (pc.isInvisble())
      return; 
    if (pc.hasSkillEffect(55889)) {
      pc.sendPackets((ServerBasePacket)new S_ServerMessage("无法连续使用该功能"));
      return;
    } 
    pc.setSkillEffect(55889, 3000);
    pc.set_misslocTime(1);
  }
}
